<link rel="stylesheet" type="text/css" href="http://img-dev.myscrmimg.cn/projects/qmyx/public/css/main.css"/>
<style>
    .nav-tabs > li > a {
        border: 0;
        border-radius: 0;
    }

    .nav-tabs > li > a {
        margin-right: 2px;
        line-height: 1.42857143;
    }

    .nav > li > a {
        position: relative;
        display: block;
        padding: 10px 15px;
        color: #337ab7;
    }

    :after, :before {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
    }

    .nav:before, .nav:after {
        display: table;
        content: '';
    }

    .nav:after {
        clear: both;
    }

    .areabox {
        background: #fff;
        width: 430px;
    }

    .areabox .nav-tabs {
        padding: 0;
        margin: 0;
        -webkit-padding-start: 0px;
    }

    .areabox .tab-content {
        width: 408px;
        height: 210px;
        padding: 5px 0;
        margin-top: -1px;
    }

    .nav-tabs {
        border-bottom: 1px solid #ddd;
    }

    .nav-tabs > li {
        float: left;
        margin-bottom: -1px;
    }

    .nav > li {
        position: relative;
        display: block;
    }

    ul, li {
        list-style: none;
    }

    .tab-content > .tab-pane {
        display: none;
        visibility: hidden;
    }

    .tab-content > .active {
        display: block;
        visibility: visible;
    }

    .areabox .tab-content ul {
        padding: 0;
        margin: 0;
        -webkit-padding-start: 0px;
    }

    .popover {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1060;
        display: none;
        padding: 1px;
        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.42857143;
        text-align: left;
        white-space: normal;
        background-color: #fff;
        -webkit-background-clip: padding-box;
        background-clip: padding-box;
        border: 1px solid #ccc;
        border: 1px solid rgba(0, 0, 0, .2);
        border-radius: 6px;
        -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
        box-shadow: 0 5px 10px rgba(0, 0, 0, .2)
    }

    .popover.top {
        margin-top: -10px
    }

    .popover.right {
        margin-left: 10px
    }

    .popover.bottom {
        margin-top: 10px
    }

    .popover.left {
        margin-left: -10px
    }

    .popover-title {
        padding: 8px 14px;
        margin: 0;
        font-size: 14px;
        background-color: #f7f7f7;
        border-bottom: 1px solid #ebebeb;
        border-radius: 5px 5px 0 0
    }

    .popover-content {
        padding: 9px 14px
    }

    .popover > .arrow, .popover > .arrow:after {
        position: absolute;
        display: block;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid
    }

    .popover > .arrow {
        border-width: 11px
    }

    .popover > .arrow:after {
        content: "";
        border-width: 10px
    }

    .popover.top > .arrow {
        bottom: -11px;
        left: 50%;
        margin-left: -11px;
        border-top-color: #999;
        border-top-color: rgba(0, 0, 0, .25);
        border-bottom-width: 0
    }

    .popover.top > .arrow:after {
        bottom: 1px;
        margin-left: -10px;
        content: " ";
        border-top-color: #fff;
        border-bottom-width: 0
    }

    .popover.right > .arrow {
        top: 50%;
        left: -11px;
        margin-top: -11px;
        border-right-color: #999;
        border-right-color: rgba(0, 0, 0, .25);
        border-left-width: 0
    }

    .popover.right > .arrow:after {
        bottom: -10px;
        left: 1px;
        content: " ";
        border-right-color: #fff;
        border-left-width: 0
    }

    .popover.bottom > .arrow {
        top: -11px;
        left: 50%;
        margin-left: -11px;
        border-top-width: 0;
        border-bottom-color: #999;
        border-bottom-color: rgba(0, 0, 0, .25)
    }

    .popover.bottom > .arrow:after {
        top: 1px;
        margin-left: -10px;
        content: " ";
        border-top-width: 0;
        border-bottom-color: #fff
    }

    .popover.left > .arrow {
        top: 50%;
        right: -11px;
        margin-top: -11px;
        border-right-width: 0;
        border-left-color: #999;
        border-left-color: rgba(0, 0, 0, .25)
    }

    .popover.left > .arrow:after {
        right: 1px;
        bottom: -10px;
        content: " ";
        border-right-width: 0;
        border-left-color: #fff
    }

    .nav-tabs > li > a {
        border: 0;
        border-radius: 0;
    }

    .nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover {
        color: #fff;
        border: none;
        background-color: #FF7713
    }

    .popover {
        border-radius: 0;
        padding-top: 0;
        left: 0 !important;
    }

    .popover-title {
        border-radius: 0;
    }

    .popover.bottom > .arrow {
        left: 42px !important;
    }

    .popover.bottom > .arrow:after {
        border-bottom-color: #f7f7f7;
    }

    #tree_table {
        position: absolute;
        background: #fff;
        width: 100%;
        max-height: 200px;
        overflow: auto;
        border-bottom: 1px solid #d9d9d9;
        webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
        box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
        z-index: 101;
    }

    .areabox .tab-content li.on {
        color: #FF7713;
        background: transparent;
    }

    .setp-ctrl {
        left: 20px;
        right: 0;
        background: transparent;
        bottom: 0;
        height: 55px;
        z-index: 100;
    }

    .setp-ctrl .btns {
        display: table;
        margin: 10px auto;
    }

    .setp-ctrl a {
        display: inline-block;
        width: 110px;
        height: 33px;
        line-height: 33px;
        border-radius: 2px;
        margin: 0 6px;
        background: #ff7713;
        color: #fff;
        font-size: 14px;
        text-align: center;
        text-decoration: none;
    }

    .warp-content {
        position: relative;
        min-height: 300px;
        max-height: 350px;
        margin-bottom: 60px;
        margin-top: 20px;
        overflow: auto;
        padding-bottom: 0px;
    }

    .add_project .sheet {
        position: relative;
        margin-bottom: 20px;
        content: "";
        display: block;
        background-color: #eee;
        margin-left: 1px;
        padding-bottom: 4px;
    }

    .add_project .sheet table {
        background-color: #fff;
    }

    .add_project .sheet th, .add_project .sheet td {
        padding: 0;
    }
    .yzh-icon { background-image: url(http://img-dev.myscrmimg.cn/projects/qmyx/public/images/icon/yzh_icon.png?v=201511181152); background-repeat: no-repeat; background-position: 4999px 4999px; display: inline-block; vertical-align: middle; }
    .yzh-icon-5003 { background-position: 0 -72px; }/*全民营销*/
    .yzh-icon-5002 { background-position: 0 -136px; }/*移动销售*/
    .yzh-icon-5020 { background-position: 0 -200px; }/*秒杀活动*/
    .yzh-icon-5008 { background-position: 0 -392px; }/*小蜜蜂*/
    .yzh-icon-5021 { background-position: 0 -1606px; } /* 认筹理财 */
    .yzh-icon-6001 { background-position: 0 -2647px; }/*云服务*/
    .yzh-icon-5001, .yzh-icon-5009 { background-position: 0 -1668px; }  /* 微楼书 */

    .yzh-icon-new-5002 { background-position: 0 -136px; }/*移动销售*/
    .yzh-icon-new-5003,.yzh-icon-new-5008 { background-position: 0 -1853px; }/*渠道管家*/
    .yzh-icon-new-5020,.yzh-icon-new-5021 { background-position: 0 -2514px; }/*掌上售楼处*/

    .yzh-icon-new-5001, .yzh-icon-new-5009 { background-position: 0 -1668px; }  /* 微楼书 */
    .yzh-icon-5030,.yzh-icon-new-5030  { background-position: 0 -3381px; } /* 旺财宝 */
    .sheet td i { width: 61px; height: 61px; }
</style>
<div class="content add_project" style="width:750px;">
    <div class="step-info">
        <div class="step-for">新增项目：</div>
        <div class="step-wrap">
            <table class="steps" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="first-step {{cur_step==1?'active':''}}">
                        <div>1.填写基本信息<span class="after"></span></div>
                    </td>
                    <td class="{{cur_step==2?'active':''}}">
                        <div><span class="before"></span>2.绑定ERP项目<span class="after"></span></div>
                    </td>
                    <td class="{{cur_step==3?'active':''}}">
                        <div><span class="before"></span>3.项目授权</div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="first-step-warp warp-content" style="overflow: inherit;">
        <div class="grid-header mt15 grid-header-left-line" style="position: relative; margin-bottom: 10px;">
            <div class="clearfix" style="padding-bottom:4px;">
                <span class="fl f14 lh30 text-indent">填写基本信息</span>
            </div>
            <div class="tab-bottom-line"></div>
        </div>
        <form name="projectInfoForm" novalidate>
            <table width="100%" class="mt15">
                <tr>
                    <td width="135" align="right" class="form-cell" valign="top"><span class="c-red">* </span>项目名称：</td>
                    <td class="cell-split-s">
                        <input type="text" ng-model="projectName" name="projectName" proj-name-allow  class="input-text fl mr10" placeholder="项目名称" value=""
                               style="width:400px" required>

                        <div ng-messages="projectInfoForm.projectName.$error"
                             ng-show="projectInfoForm.$submitted || projectInfoForm.projectName.$touched">
                            <p class="c-red lh30" ng-message="required">项目名称不能为空</p>
                            <p class="c-red lh30" ng-message="projNameAllow">项目名称重复</p>
                        </div>
                </tr>
                <tr>
                    <td align="right" class="form-cell" valign="top"><span class="c-red">* </span>项目所在地：</td>
                    <td class="cell-split">
                        <div class="fl select mr10" style="width:400px;">
                        <span class="select-border js-select">
                            <input class="select-text" id="address" name="address" ng-model="address"
                                   readonly="readonly" placeholder="选择所在地" data-label="项目所在地" type="text" value=""
                                   province="" city="" district="" required/>
                            <span class="select-icon"><i class="select-icon-arrow"></i></span>
                        </span>
                        </div>
                        <div ng-messages="projectInfoForm.address.$error"
                             ng-show="projectInfoForm.$submitted || projectInfoForm.address.$touched">
                            <p class="c-red lh30" ng-message="required">项目所在地不能为空</p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="form-cell" valign="top"><span class="c-red">* </span>所属公司：</td>
                    <td class="cell-split">
                        <div class="fl select mr10" style="width:400px;">
                        <span class="select-border js-select">
                            <input class="select-text" type="text" ng-disabled="addProjectPeriod_puid" readonly ng-click="toggleTreeCombo()"
                                   name="belongsCompany_name"
                                   ng-model="belongsCompany.name"
                                   placeholder="" required/>
                            <span class="select-icon"><i class="select-icon-arrow"></i></span>
                        </span>

                            <div id="tree_table" ng-show="isTreeCollapse">加载中...</div>
                        </div>
                        <div ng-messages="projectInfoForm.belongsCompany_name.$error"
                             ng-show="projectInfoForm.$submitted || projectInfoForm.belongsCompany_name.$touched">
                            <p class="c-red lh30" ng-message="required">所属公司不能为空</p>
                        </div>
                    </td>
                </tr>
            </table>
            <button type="submit" id="submitBtn" style="display: none;"/>
        </form>
    </div>
    <div class="second-step-warp  warp-content"  style="display: none;">
        <div class="grid-header mt15 grid-header-left-line" style="position: relative; margin-bottom: 10px;">
            <div class="clearfix" style="padding-bottom:4px;">
                <span class="fl f14 lh30 text-indent">绑定ERP项目</span>
            </div>
            <div class="tab-bottom-line"></div>
        </div>


        <div class="mt20">
            <div class="mt15 clearfix">
                <div class="fr btn-group">
                    <a href="javascript:;"
                       ui-dialog="绑ERP项目"
                       ui-dialog-ok="bindERPProject()"
                       ui-dialog-show="showERPProject($dialog,$dialogScope)"
                       ui-dialog-before-show="beforeShowERPProject($dialog,$dialogScope)"
                       ui-dialog-url="inc/dialog/bind_erp.html"
                       class="btn" ui-dialog="绑ERP项目">绑ERP项目</a>
                </div>
            </div>
            <div class="sheet">
                <table width="100%" class="mt5 jqtree-tree">
                    <thead>
                    <tr>
                        <th height="34">项目名称</th>
                        <th style="width:300px">操作</th>
                    </tr>
                    </thead>

                    <tbody>
                    <tr ng-repeat="item in bindErpList">
                        <td height="34">
                            {{item.Erp_ProjectName}}<span ng-show="item.DefaultProject==1" class="default_proj_label">默认项目</span>
                        </td>
                        <td style="text-align: left;text-align: center;">
                            <a ng-show="item.DefaultProject!=1" href="javascript:void(0)" title="设为默认"
                               ng-click="setDefault(item)" class="mr15 c-orange">
                                设为默认
                            </a>
                            <a href="javascript:void(0)" title="取消项目" ng-click="cancelBind(item)" class="mr15 c-orange">
                                取消项目
                            </a>
                        </td>
                    </tr>
                    <tr ng-show="bindErpList.length<1">
                        <td height="34" colspan="2">
                            <span style="color:#dcdcdc;">还没有绑定ERP项目</span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <p class="mt15" style="background-color: #fff8ee;padding: 15px;">
                提示：如果绑定多个ERP项目，需要设置默认项目，用于云客数据向ERP同步时，存储到设置的默认ERP项目。如果客户未使用明源ERP系统，可以跳过此步，进行下一步操作</p>
        </div>


    </div>
    <div class="third-step-warp  warp-content" style="display: none;">
        <div class="grid-header mt15 grid-header-left-line" style="position: relative; margin-bottom: 10px;">
            <div class="clearfix" style="padding-bottom:4px;">
                <span class="fl f14 lh30 text-indent">项目授权</span>
            </div>
            <div class="tab-bottom-line"></div>
        </div>
        <div ng-include="'inc/dialog/project_role_detail.html'"></div>

        <!--<div class="sheet mt15 clearfix"  ng-repeat="item in projAuthList">-->
            <!--<table width="100%">-->
                <!--<tbody>-->
                <!--<tr>-->
                    <!--<td width="100">-->
                        <!--<i class="yzh-icon yzh-icon-{{cur_bind_mode?'new-'+item.Application:item.Application}}"></i>-->

                        <!--<p class="mt10 P14">{{item.FriendlyName}}</p>-->
                    <!--</td>-->
                    <!--<td style="border-left: none;border-bottom:1px solid #d9d9d9;border-top: 1px solid #d9d9d9;border-right:none;">-->
                        <!--<table width="100%">-->
                            <!--<tbody ng-repeat="cont_item in item.contracts">-->
                            <!--<tr>-->
                                <!--<td colspan="3" width="350" height="34" style="border-left: none;border-top:none;">-->
                                    <!--<p class="text-left p15"><span>合同：{{cont_item.PartyA}}</span><span class="ml40">租期：{{cont_item.BeginOn | limitTo:10}}至{{cont_item.EndOn | limitTo:10}}</span>-->
                                    <!--</p>-->
                                <!--</td>-->
                                <!--<td rowspan="2" style="border-bottom: none;">-->
                                    <!--<button href="javascript:;" class="btn" ng-show="cont_item.binding==0"-->
                                       <!--ng-disabled="cont_item.total_num<=cont_item.use_num||(cur_bind_mode&&!item.isZsslc&&check_can_bind().length<1)"-->
                                       <!--ng-click="bindAuth(item,cont_item)">绑定授权</button>-->
                                    <!--<button href="javascript:;" class="btn btn-yellow" ng-show="cont_item.binding==1"-->
                                       <!--ng-disabled="0>=cont_item.use_num||(cur_bind_mode&&item.isZsslc&&check_can_cancel().length>0)" ng-click="cancelAuth(item,cont_item)">取消授权</button>-->
                                <!--</td>-->
                            <!--</tr>-->
                            <!--<tr>-->
                                <!--<td style="border-left: none;">-->
                                    <!--<P class="text-left p15 f14">总授权</P>-->

                                    <!--<P style="text-align: right;" class="p15 f24">{{cont_item.total_num}}</P>-->
                                <!--</td>-->
                                <!--<td style="border-bottom: none;">-->
                                    <!--<P class="text-left p15 f14">已使用</P>-->

                                    <!--<P style="text-align: right;" class="p15 f24 c-orange">{{cont_item.use_num}}</P>-->
                                <!--</td>-->
                                <!--<td style="border-bottom: none;">-->
                                    <!--<P class="text-left p15 f14">可用</P>-->

                                    <!--<P style="text-align: right;" class="p15 f24 c-green">-->
                                        <!--{{cont_item.total_num-cont_item.use_num}}</P>-->
                                <!--</td>-->
                            <!--</tr>-->
                            <!--</tbody>-->
                        <!--</table>-->
                    <!--</td>-->
                <!--</tr>-->
                <!--<tr ng-show="projAuthList.length<1">-->
                    <!--<td height="50"><span style="color: #d9d9d9;">暂无数据</span></td>-->
                <!--</tr>-->
                <!--</tbody>-->
            <!--</table>-->
        <!--</div>-->

    </div>
    <div class="setp-ctrl">
        <div class="btns">
            <a class="pre" ng-show="cur_step!=1" href="#" ng-click="prevStep()">上一步</a>
            <a class="next" ng-show="cur_step!=3" href="#" ng-click="nextStep(projectInfoForm.$valid)">下一步</a>
            <a class="" ng-show="cur_step==3" href="#" ng-click="completeNewProject()">完成</a>
            <a class="cancalset cancel" ng-click="closeAddDialog()" href="#">取消</a>
        </div>
    </div>
</div>